#ifndef GT_OPTION_H
#define GT_OPTION_H

#include "config.h"
#include "gt_list.h"
#include "isearch.h"

#ifdef LINE_MAX
#undef LINE_MAX
#endif
#define LINE_MAX 512

enum search_type_t {
  GREP_SEARCH = 0, // grep
  AG_SEARCH,       // ag
  GIT_SEARCH,      // git

  NUM_SEARCHES
};

struct option_t {
  const pcre *pcre_compiled;
  const pcre_extra *p_extra;
  char editor[LINE_MAX];
  char directory[PATH_MAX];

  char pattern[LINE_MAX];

  gt_list *specific_file;
  gt_list *extension;
  gt_list *ignore;

  int raw_option;
  int regexp_option;
  int extension_option;
  int incase_option;
  int ignore_option;
  int regexp_is_ok;

  search_type_t search_type;
  char parser_cmd[NUM_SEARCHES][LINE_MAX];
  char parser_options[LINE_MAX];
};

option_t *create_option(configuration_t *config, int argc, char *argv[]);

void free_option(option_t *option);

#endif // header file protect
       // ok